package com.ct.ecommerce.framework.enums;

/**
 * @author changtong
 * @since 2021/6/16
 */
public enum ECommerceCodeEnum {
    /**
     * 商品库存不足
     */
    GOODS_NUM_NOT_ENOUGH(false, 10001, "商品库存不足"),
    /**
     * 用户余额不足
     */
    USER_NOT_ENOUGH_BALANCE(false,10002,"用户余额不足"),
    /**
     * 商品不存在
     */
    GOODS_NO_EXIST(false, 10003, "商品不存在"),
    /**
     * 订单保存失败
     */
    ORDER_SAVE_ERROR(false, 10004, "订单保存失败"),

    /**
     * 填写订单信息错误
     */
    ORDER_INFO_ERROR(false,10005,"填写订单信息错误,请检查表单")
    ;


    private final Boolean success;
    private final Integer code;
    private final String message;

    ECommerceCodeEnum(Boolean success, Integer code, String message) {
        this.success = success;
        this.code = code;
        this.message = message;
    }

    public Boolean getSuccess() {
        return success;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    @Override
    public String toString() {
        return "ECommerceCodeEnum{" +
            "success=" + success +
            ", code=" + code +
            ", message='" + message + '\'' +
            '}';
    }
}
